import java.awt.*;
import java.util.Random;

public class MyRectangle implements Shapes{
	private int x;
	private int y;
	private int width;
	private int height;
	private Color color;

	@Override
	public void draw(Graphics g)
	{
		g.setColor(color);
		g.drawRect(x,y,width,height);
	}
	public MyRectangle(){}
	public MyRectangle(int x,int y,int width,int height,Color color){
		this.x=x;
		this.y=y;
		this.width=width;
		this.height=height;
		this.color=color;
	}

	@Override
	public Shapes random() {
		Random random=new Random();
		Color color1=new Color(random.nextInt(255),random.nextInt(255),random.nextInt(255));
		MyRectangle myRectangle=new MyRectangle(random.nextInt(400), random.nextInt(300), random.nextInt(200), random.nextInt(200), color1);
		return myRectangle;
	}
}
